﻿using Sunny.UI;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Resources;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Language;
namespace StationDemo.FrameUI
{
    public partial class Form_正在复位 : UIForm
    {
        public Form_正在复位()
        {
            InitializeComponent();
            //LanguageHelp.GetInstance().Function_FormRegist(this);
            //LanguageHelp.GetInstance().Funtion_TransLate(this.Name);
            BtnClose.Enabled = false;
            timer1.Interval = 200;
            timer1.Start();
        }

        public bool bEn
        {

            set {
                
                BtnClose.Enabled = true;
                if(value)
                {
                    BtnClose.Text="成功";
                    pictureBox1.Image = Properties.Resources.Homeok;

                }
                else
                {
                    BtnClose.Text = "失败";
                    pictureBox1.Image = Properties.Resources.alarm;


                }

            }
            get { return BtnClose.Enabled; }
        }

        public void InfoAndProcess(string strInfo,int n_Value)
        {
            lbl_HomeInfo.Text = strInfo;
            pb_Home.Value = n_Value;
        }

        private void BtnClose_Click(object sender, EventArgs e)
        {
            this.Close();
            this.Dispose();
        }

        private void Form_正在复位_Load(object sender, EventArgs e)
        {
            //this.pictureBox1.Image = (Image)ResourceManager.GetObject("pictureBox1.Image");
            //System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager();
            //this.pictureBox1.Image = ((System.Drawing.Image)(resources.GetObject("HandInH")));
        }

        private void timer1_Tick(object sender, EventArgs e)
        {
            if( BaseDll.GlobalVariable.g_StationState != BaseDll.StationState.StationStateHoming &&
                BaseDll.GlobalVariable.g_StationState != BaseDll.StationState.StationStatePause)
            {
                this.Close();
                this.Dispose();

            }
        }
    }
}
